package com.cooper.loader.impl;

import java.util.Properties;

import org.apache.velocity.app.Velocity;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;

import com.cooper.loader.Loader;

public class VelocityLoader implements Loader{

	@Override
	public void init() throws Exception {
		Properties props = new Properties();
		ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
		org.springframework.core.io.Resource resource = resourcePatternResolver.getResource("classpath:velocity.properties");
		props.load(resource.getInputStream());
//		props.put("file.resource.loader.class", "com.asiainfo.core.VelocityStringResourceLoader");
		
		Velocity.init(props);
	}
	
	@Override
	public void destroy() throws Exception {
		// TODO Auto-generated method stub

	}

}
